#!/bin/bash

# This script is used to seek out X and destroy. 
# Called when user logs out from the HSC

# the ps/grep command may find and return its own pid.
# so rather than search the results for the actual X
# pid, issue a kill to all pids returned.
# at worst we waste a kill on a non-existent ps command

X_PROC_ID=`ps -ef | grep /etc/X11/X | awk {'print $2'}`

for i in $X_PROC_ID
  do
    kill -15 $i
  done

